<template>
	<view>
		<view style="height: 321rpx;padding:0 30rpx 0; border-radius: 0 0 40rpx 40rpx;background-color: #00C657;">
			<view style="color: #fff; margin-bottom: 31rpx;display: flex;align-items: center;flex-wrap: wrap;">
				<view style="margin-top: 20rpx;">
					<view style="display: flex;align-items: center;margin-bottom: 10rpx;" @click="cut">	
						<text>自提点：{{ communityName }}</text>
						<text style="font-size: 28rpx;margin-right: 10rpx;">切换</text>
						<image src="/static/waimai/fh.png" style="width: 10rpx;height: 17rpx;" mode="aspectFit"></image>
					</view>
					
					<view @click="map">
						<image src="/static/dw.png" style="width: 23rpx;height: 25rpx;" mode="aspectFit"></image>
						<text style="font-size: 24rpx;margin: 0 18rpx 0 9rpx;">{{ ziti_name }}</text>
						<text style="font-size: 24rpx;">{{ disUserName }}</text>
					</view>
				</view>
			</view>
			<view style="position: relative;">
				<image src="/static/index/search.png" style="width: 24rpx;height: 24rpx;position: absolute;top: 25rpx;left: 20rpx;" mode="aspectFit"></image>
				<input
					type="text"
					value=""
					placeholder-style="font-size:24rpx;color:#9EA9B7;"
					placeholder="请输入商品名称"
					style="padding-left: 64rpx; width: 630rpx;height: 72rpx;background-color: #F4F4F4;border-radius: 15rpx;"
				/>
			</view>
            <!-- 团购首页轮播 -->
			<view class="banner-swiper screen-swiper square-dot">
				<view style="margin: 20rpx 20rpx 0;">
					<swiper indicator-dots="true" indicator-color="#CBCCCE" indicator-active-color="#fff" circular="true"
						autoplay="true" interval="3000">
						<swiper-item v-for="(item, index) in swipers" :key="index.id" style="border-radius: 10rpx;">
							<image :src="item" style="width: 710rpx;height: 300rpx;" mode="aspectFill">
							</image>
						</swiper-item>
					</swiper>
				</view>
			</view>
		</view>
		<!-- 限时秒杀 -->
		<view style="width: 690rpx;box-shadow: 0 0 5rpx 1rpx #f1f1f1;margin: 250rpx 30rpx 0;border-radius: 20rpx;">
			<view style=" display: flex;align-items: center;justify-content: space-between;padding: 30rpx 0 30rpx 30rpx;">
				<view style="color: #FF586D;display: flex;align-items: center;">
					<image src="/static/shequ/miaosha.png" style="margin-right: 10rpx; width: 179rpx;height: 40rpx;" mode="aspectFill"></image>
					<uni-countdown :showDay="false" :minute="59" :second="59" backgroundColor="#FF586D;" color="white">
					</uni-countdown>
				</view>
				<view style="display: flex;align-items: center;">
					<text style="font-size: 24rpx;color: #B5B5B5;">更多</text>
					<image src="/static/index/right.png" style="width: 8rpx;height: 15rpx;padding: 0 20rpx 0 5rpx;" mode="aspectFit"></image>
				</view>
			</view>
			<scroll-view scroll-x="true" scroll-left="31rpx" style="display: inline-block;white-space: nowrap;padding-left: 30rpx;">
				<!-- <block>
					<view style="display: flex;flex-wrap: nowrap;">
						<view style="display: flex;flex-direction: column;margin-right:29rpx;width: 150rpx;">
							<view
								style="width: 150rpx;height: 150rpx;border-radius: 10rpx;background-color: #F7F7F7;display: flex;align-items: center;justify-content: center;">
								<image src="" style="width: 130rpx;height: 117rpx;background-color: #707895;"
									mode="aspectFill"></image>
							</view>
							<text
								style="font-size: 26rpx;width: 127rpx; height: 60rpx; color: #1B1B1B;margin-top: 14rpx;"
								class="line">藤椒抄手</text>
							<view style="display: flex;align-items: center;justify-content: space-between;">
								<view style="display: flex;flex-direction: column;">
									<text style="font-size: 32rpx;color: #F61B00;">¥14.5</text>
									<text
										style="font-size: 20rpx;color: #B4B4B4;text-decoration: line-through;">¥20.5</text>
								</view>
								<image src="/static/shequ/加%20(1)@2x.png" style="width: 40rpx;height: 40rpx;"
									mode="aspectFit"></image>
							</view>
						</view>
					</view>															
				</block>  -->
				<block v-for="(v, index) in HotDataList" :key="index">
					<view class="HotData" style="display: inline-block;margin-right: 30rpx;">
						<view @click="goDetail(v.actId)"
						style="width: 150rpx;height: 150rpx;background: #F7F7F7;border-radius: 10rpx;display: flex;align-items: center;justify-content: center;">
							<image :src="v.skuImage" style="width: 130rpx;height: 117rpx;"></image>
						</view>
						<text>{{ v.spuName }}</text>
						<view style="display: flex;flex-direction: row;align-items: center;justify-content: space-between;">
							<view style="display: flex;align-items: center;flex-direction: column;">
								<text style="font-size: 32rpx;color: #F61B00;">{{ v.actPrice[0] }}.{{ v.actPrice[1] }}</text>
								<text style="font-size: 20rpx;color: #B4B4B4;text-decoration: line-through;">{{ v.marketPrice[0] }}.{{ v.marketPrice[1] }}</text>
							</view>
							<image src="/static/shequ/add.png" style="width: 40rpx;height: 40rpx;" mode="aspectFit"
								@click="addCart(index,'hot')"></image>
						</view>
					</view>
				</block>
			</scroll-view>
		</view>

		<!-- 会员 -->
		<view style="margin: 30rpx 30rpx;display: flex;justify-content: space-between;">
			<navigator url="/pages/kaitong/kaitong"><image src="/static/meishi/kaitong.png" style="width: 338rpx;height: 143rpx;" mode="aspectFill"></image></navigator>
			<navigator url="/pages/cz/cz"><image src="/static/meishi/chongzhi.png" style="width: 338rpx;height: 143rpx;" mode="aspectFill"></image></navigator>
		</view>
		<!-- 拼团 -->
		<view style="width: 690rpx;height: 430rpx; box-shadow: 0 0 5rpx 1rpx #f1f1f1;margin: 0 30rpx;border-radius: 20rpx;">
			<view style=" display: flex;align-items: center;justify-content: space-between;padding: 30rpx 0 30rpx 30rpx;">
				<view style="display: flex;align-items: center;">
					<image src="/static/shequ/pingtuan.png" style="margin-right: 10rpx; width: 68rpx;height: 33rpx;" mode="aspectFill"></image>
					<text style="font-size: 24rpx;color: #999999;">限量拼团，每日精选</text>
				</view>
				<view style="display: flex;align-items: center;">
					<text style="font-size: 24rpx;color: #B5B5B5;">更多</text>
					<image src="/static/index/right.png" style="width: 8rpx;height: 15rpx;padding: 0 20rpx 0 5rpx;" mode="aspectFit"></image>
				</view>
			</view>
			<scroll-view scroll-x="true" scroll-left="31rpx" style="white-space: nowrap;padding-left: 30rpx;display: flex;">
				<block v-for="(bok, index3) in booking" :key="index3">
					<view style="display: inline-block;">
						<view style="position: relative; flex-direction: row;margin-right:29rpx;width: 210rpx;">
							<view style="position: absolute;top: 0;left: 0;">
								<view style="position: relative;">
									<image src="/static/shequ/pingtuan1.png" style="width: 64rpx;height: 35rpx;" mode="aspectFit"></image>
									<text style="color: #fff;font-size: 18rpx;position: absolute;top: 0;left: 2%;">6人团</text>
								</view>
							</view>
							<view
								style="width: 210rpx;height: 175rpx;border-radius: 10rpx;background-color: #F7F7F7;display: flex;align-items: center;justify-content: center;"
								@click="goDetail(bok.actId)"
							>
								<image :src="bok.skuImage" style="background-color: #707895; width: 130rpx;height: 117rpx;" mode="aspectFill"></image>
							</view>
							<text style="font-size: 26rpx;height: 60rpx; color: #1B1B1B;margin-top: 14rpx;width: 179rpx;" class="line">{{ bok.spuName }}</text>
							<view style="display: flex;align-items: center;justify-content: space-between;">
								<view style="display: flex;flex-direction: column;">
									<text style="font-size: 32rpx;color: #F61B00;">¥{{ bok.actPrice[0] + '.' + bok.actPrice[1] }}</text>
									<text style="font-size: 20rpx;color: #B4B4B4;text-decoration: line-through;">¥{{ bok.marketPrice[0] + '.' + bok.marketPrice[1] }}</text>
								</view>
								<image src="/static/shequ/add.png" style="width: 40rpx;height: 40rpx;" mode="aspectFit"
									@click="addCart(index3,'pin')"></image>
							</view>
						</view>
					</view>
				</block>
			</scroll-view>
		</view>
		<view style="height: 20rpx;background-color: #F7F7F7;margin: 30rpx 0;"></view>
		<!-- 附近推荐 -->
		<view>
			<view class="horizonal-tab">
				<scroll-view scroll-x="true" scroll-with-animation class="scroll-tab">
					<block v-for="(item, index) in contentList" :key="index">
						<view class="scroll-tab-item" :class="{ active: tabIndex === index }" @tap="toggleTab(index)">
							{{ item }}
							<view class="select"></view>
						</view>
					</block>
				</scroll-view>
			</view>
			<!-- 内容区 -->
			<view style="margin-bottom: 50rpx;">
				<!-- 滑块视图 -->
				<scroll-view scroll-y="true" scroll-left="30rpx" style="display: inline-block;white-space: nowrap;padding-left: 30rpx;">
					<block v-for="(item1, index1) in productList" :key="index1">
						<view class="product">
							<view class="it1"><image :src="item1.skuImage"></image></view>
							<view class="it2" @click="goDetail(item1.actId)">
								<text style="font-size: 30rpx;color: #1B1B1B;margin-top: 14rpx;">{{ item1.spuName }}</text>
								<view class="xinren">
									<text style="margin-right: 15rpx;">新品发布</text>
									<text>新人专享</text>
								</view>
								<view style="display: flex;align-items: center;	margin-top: 20rpx;">
									<text style="font-size: 24rpx;color: #F61B00;">￥</text>
									<text style="font-size: 36rpx;color: #F61B00;">{{ item1.actPrice[0] }}.{{ item1.actPrice[1] }}</text>
									<text style="font-size: 24rpx;color: #B4B4B4;text-decoration: line-through;">{{ item1.marketPrice[0] }}.{{ item1.marketPrice[1] }}</text>
								</view>
							</view>
							<view class="it3"><image src="/static/shequ/add.png" style="width: 40rpx;height: 40rpx;" mode="aspectFit" @click="addCart(index1,'tab')"></image></view>
						</view>
					</block>
				</scroll-view>
			</view>
		</view>
		<view @click="open" style=" display: flex;align-items: center;justify-content: space-between;height: 70rpx;background-color: #F7F7F7;padding: 0 30rpx;">
			<view style="color: #1B1B1B;font-size: 24rpx;">
				<text style="font-size: 28rpx;color: #1B1B1B;">优惠券</text>
				<text style="margin: 0 30rpx 0 20rpx;">满200元减30元</text>
				<text>满100元减5元</text>
			</view>
			<image src="/static/index/right.png" style="width: 13rpx;height: 21rpx;" mode="aspectFit"></image>
		</view>


		<uni-popup ref="popup" type="bottom" :mask-click="false">
			<view style="border-radius: 30rpx 30rpx 0 0;background-color: #fff;padding-top: 45rpx;box-sizing: border-box;">
				<view style="display: flex;flex-direction: column;">
					<image src="/static/login/qx.png" style="width: 24rpx;height: 19rpx;margin: 10rpx 30rpx 0 680rpx;" @click="close" mode="aspectFit"></image>
					<text style="font-size: 34rpx;color: #1B1B1B;margin: 0 290rpx">优惠券领取</text>
				</view>
				<!-- 优惠券 -->
				<block v-for="(tic, index) in tickets" :key="index">
					<view style="display: flex; font-size: 24rpx;box-shadow: 0 0 5rpx 2rpx #f7f7f7;width: 690rpx;height: 170rpx;border-radius: 24rpx;margin: 60rpx auto -10rpx;">
						<view style="color: #FF6F00;margin-left: 26rpx;display: flex;align-items: center;">
							<text>¥</text>
							<text>{{ tic.credit }}</text>
						</view>
						<view style="color: #999;display: flex;flex-direction: column;margin: 33rpx 0 33rpx 30rpx;line-height: 40rpx;">
							<text style="font-size: 32rpx;color: #1B1B1B;">{{ tic.voucher_title }}</text>
							<text>{{ tic.limit_money == 0 ? '无门槛' : '满 tic.limit_money 可用' }}</text>
							<text>{{ tic.end_time }}到期</text>
						</view>
						<button
							v-if="tic.is_collect == 0"
							type="default"
							style="width: 150rpx;height: 60rpx;border-radius: 30rpx;font-size: 24rpx;color: #fff;background-color: #00C657;margin: 55rpx 30rpx 55rpx 180rpx;"
							@click="changeState(tic.id, tic.is_collect)"
						>
							领取
						</button>
						<button
							v-else
							type="default"
							style="width: 150rpx;height: 60rpx;border-radius: 30rpx;font-size: 24rpx;color: #fff;background-color: #00C657;margin: 55rpx 30rpx 55rpx auto;"
							@click="skip"
						>
							去使用
						</button>
					</view>
				</block>
			</view>
			<view style="background-color: #fff;height: 80rpx;"></view>
		</uni-popup>
		
		
		<view style="position: fixed; bottom:0;right:0;background-color: #FFFFFF;">
			<view style="height: 110rpx;display: flex;justify-content: space-between;">
				<view style="display: flex;width: 510rpx;justify-content: space-between;align-items: center;">
					<navigator url="../shoppingCart/shoppingCart">
						<view style="padding-left: 30rpx; display: flex;align-items: center;">
							<image src="/static/shequ/cart.png" style="width: 40rpx;height: 39rpx;" mode="aspectFit"></image>
							<text style="font-size: 24rpx;color: #1B1B1B;margin-left: 10rpx;">已选{{ num }}</text>
						</view>
					</navigator>
					<text style="font-size: 20rpx;font-weight: bold;color: #F61B00;padding-right: 30rpx;">¥{{ totalPrice }}</text>
				</view>
				<button
					type="default"
					style="width: 240rpx;height: 110rpx;background-color: #00C657;color: #fff;font-size: 32rpx;display: flex;align-items: center;justify-content: center;border-radius: 0;"
					@click="pay"
				>
					去支付
				</button>
			</view>
		</view>
		<!-- #ifdef H5 -->
		<view>
			<text>H5页面H5页面H5页面H5页面</text>
		</view>
		<!-- #endif -->
		<view style="display: block; width: 100%;height: 150rpx;"></view>
	</view>
</template>

<script>
import {
	Storage
} from '@/static/libs/utils.js'
export default {
	data() {
		return {
			swipers:[
				'https://dss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=3206689113,2237998950&fm=26&gp=0.jpg',
				'https://ss1.bdstatic.com/70cFuXSh_Q1YnxGkpoWK1HF6hhy/it/u=1070003001,653753576&fm=26&gp=0.jpg',
				'https://ss0.bdstatic.com/70cFuHSh_Q1YnxGkpoWK1HF6hhy/it/u=1361135963,570304265&fm=26&gp=0.jpg'
			],
		    HotDataList: [],
			communityName: '',
			ziti_name: '',
			disUserName: '',
			contentList: [],
			nav_list_data: [],
			tabIndex: 0,
			dots: {
				backgroundColor: '#BFC695',
				selectedBackgroundColor: '#fff',
				bottom: 175
			},
			current: 0,
			info: 3,
			seckill: [],
			booking: [],
			classes: [],
			tickets: [],
			productList: [],
			num: 0,
			totalPrice: 0,
			lat:Storage.get("latitude"),
			lng:Storage.get("longitude")
		};
	},
	onLoad() {
		this.getTeamInfo()
		this.getContentList()
		this.getTicketData()
		this.token = Storage.get('token');
	},
	mounted() {
		this.getData();
	},
	onReachBottom() {//分页
		
	},
	methods: {
		// 切换地址
		cut(){
			uni.navigateTo({
				url:'/pages/shequ/communityAddr/communityAddr'
			})
		},
		// 地图导航
		map: function() {
			uni.openLocation({
				latitude: this.lat, //维度
				longitude: this.lng, //经度
				name: `${this.ziti_name}`, //目的地定位名称
				scale: 15 //缩放比例
			});
		},
		getTicket(i) {
			this.tickets[i].flag = true
			console.log(this.tickets[i]);
		},
		goDetail(actId) {
			uni.navigateTo({
				//地址栏传参
				url: "../sqxq/sqxq?id=" + actId + '&a=wxapp'
			})
		},
		toggleTab(index) {
			this.tabIndex = index;
			var to_pay = this.nav_list_data[this.tabIndex].nowPage ? this.nav_list_data[this.tabIndex].nowPage + 1 : 1;
			this.getProductList(this.nav_list_data[this.tabIndex].id, to_pay, index);
		},
		changeState(id) {
			this.$request
				.post(
					`/wxapp.php?i=undefined&t=undefined&v=undefined&from=wxapp&c=entry&a=wxapp&do=index&m=lionfish_comshop&sign=02fdd4374764e618ab963830ddf38c30&controller=goods.getQuan&token=${
						this.token
					}&id=${id}`
				)
				.then(res => {
					console.log(res);
					if (res.data.code == 0) {
						this.tickets.forEach(item => {
							if (item.id == id) {
								item.is_collect = 1;
							}
						});
					}
				});
		},
		skip() {
			uni.navigateTo({
				url: '/pages/shequ/shequ'
			});
		},
		open() {
		    this.$refs.popup.open('bottom')
		},
		close() {
			this.$refs.popup.close();
		},
		change(e) {
			this.current = e.detail.current;
		},
		getData() {
			this.token = Storage.get('token')
			// 首页秒杀
			this.$request.get(
				`/wxapp.php?i=undefined&t=undefined&v=undefined&from=wxapp&c=entry&a=wxapp&do=index&m=lionfish_comshop&sign=08872b361c999ac13617c03d5b1254e8&controller=index.load_spikebuy_goodslist&token=${this.token}&pageNum=1&head_id=1`
				)
				.then(res => {
					console.log('首页秒杀商品', res)
					// console.log(res.data)
					this.HotDataList = res.data.list
					// console.log(this.seckill);
				});
				// 拼团
			this.$request.get(
				`/wxapp.php?i=undefined&t=undefined&v=undefined&from=wxapp&c=entry&a=wxapp&do=index&m=lionfish_comshop&sign=cdc170b2bd23769c7b7bbf916e14b799&controller=goods.get_category_col_list&head_id=1&token=${this.token}`
				)
				.then(res => {
					// console.log(res.data.data[0].list)
					this.booking = res.data.data[0].list
				})
			},
			//当前团长信息
			getTeamInfo() {
				this.token = Storage.get('token')
				this.$request.get("/wxapp.php?from=wxapp&c=entry&a=wxapp&do=user", {
					controller: 'index.get_firstload_msg',
					token: this.token,
					m: 'lionfish_comshop'
				}).then(res => {
					console.log('当前团长信息', res)
					this.ziti_name = res.data.default_head_info.fullAddress
					this.communityName = res.data.default_head_info.communityName
					this.disUserName = res.data.default_head_info.disUserName
				})
			},
			//获取导航分类信息
			// getContentList() {
			// 	this.token = Storage.get('token')
			// 	this.$request.post(
			// 		"/wxapp.php?from=wxapp&c=entry&a=wxapp&do=index&m=lionfish_comshop&controller=goods.get_category_index_list", {
			// 			head_id: 1,
			// 			token: this.token
			// 		}).then(res => {
			// 			console.log('[11111111111111111111]',res)
			// 		this.nav_list_data = res.data.data
			// 		var navData = []
			// 		for (var i in res.data.data) {
			// 			navData[i] = res.data.data[i].name
			// 		}
			// 		console.log('导航信息',navData)
			// 		this.contentList = navData
			// 		this.getProductList(this.nav_list_data[0].id, 1, 0);
			// 	})
			// },
			
			getContentList() {
				this.token = Storage.get('token')
				this.$request.post(
					"/wxapp.php?from=wxapp&c=entry&a=wxapp&do=index&m=lionfish_comshop&controller=goods.get_category_list", {
						// head_id: 1,
						// token: this.token
						is_type_show:1
					}).then(res => {
						console.log('[11111111111111111111]',res)
					this.nav_list_data = res.data.data
					var navData = []
					for (var i in res.data.data) {
						navData[i] = res.data.data[i].name
					}
					console.log('导航信息',navData)
					this.contentList = navData
					this.getProductList(this.nav_list_data[0].id, 1, 0);
				})
			},
		// 	getProductList(head_id, page, index) {
		// 		this.token = Storage.get('token')
		// 		var that = this;
		// 		this.$request.get(
		// 			"/wxapp.php?from=wxapp&c=entry&a=wxapp&do=index&m=lionfish_comshop&controller=index.load_gps_goodslist", {
		// 				token: this.token,
		// 				pageNum: page,
		// 				head_id: head_id,
		// 				//gid: //分类id
		// 				per_page: 12
		// 			}).then(res => {
		// 			// console.log('团购分类信息：',res.data.list)
		// 			if (res.data.list) {
		// 				if (that.nav_list_data[index].data) {
		// 					that.nav_list_data[index].data.concat(res.data.list);
		// 				} else {
		// 					that.nav_list_data[index].data = res.data.list;
		// 				}
		// 				that.nav_list_data[index].nowPage = page;
		// 			} else {
		// 				//没有数据了
		// 			}
		// 			that.productList = that.nav_list_data[index].data ? that.nav_list_data[index].data : '';
		// 			// this.totalPrice = this.num * (item1.actPrice[0].item1.actPrice[1])
		// 		});
		// },
		
		getProductList(head_id, page, index) {
				this.token = Storage.get('token')
				var that = this;
				this.$request.get(
					"/wxapp.php?from=wxapp&c=entry&a=wxapp&do=index&m=lionfish_comshop&controller=index.load_gps_goodslist", {
						token: this.token,
						pageNum: page,
						// head_id: head_id,
						gid: head_id, //分类id
						per_page: 12
					}).then(res => {
					// console.log('团购分类信息：',res.data.list)
					if (res.data.list) {
						if (that.nav_list_data[index].data) {
							that.nav_list_data[index].data.concat(res.data.list);
						} else {
							that.nav_list_data[index].data = res.data.list;
						}
						that.nav_list_data[index].nowPage = page;
					} else {
						//没有数据了
					}
					that.productList = that.nav_list_data[index].data ? that.nav_list_data[index].data : '';
					// this.totalPrice = this.num * (item1.actPrice[0].item1.actPrice[1])
				});
		},
		addCart(index,type) {
			var item = null;
			switch(type){
				case 'pin':
					item = this.booking[index];
				break;
				case 'tab':
					item = this.productList[index];
				break;
				case 'hot':
					item = this.HotDataList[index]
				break;
				default:
					return ;
				break;
			}
			if(!item){
				return ;
			}
			var actPrice = item.actPrice[0] + '.' + item.actPrice[1];
			// console.log('aaa',parseFloat(item));
			var price = parseFloat(this.totalPrice) + Math.floor(parseFloat(actPrice) * 100) / 100;
			this.numFilter(price);
			// console.log(this.totalPrice);

			this.token = Storage.get('token');
			//console.log('Tokenlalalalal',this.token)
			this.$request
				.post('/wxapp.php?from=wxapp&c=entry&a=wxapp&do=user&&m=lionfish_comshop', {
					controller: 'car.add',
					token: this.token,
					goods_id: item.actId,
					community_id: 1,
					quantity: item.goods_start_count,
					buy_type: 'dan',
					is_just_addcar: 1
				})
				.then(res => {
					console.log('购物车', res);
					uni.showToast({
						title: '添加成功',
						duration: 1000
					})
					this.num = this.num + 1;
				})
			},
		getTicketData() {
			//领劵中心
			console.log(this.token);
				this.$request
					.post(
						`/wxapp.php?i=undefined&t=undefined&v=undefined&from=wxapp&c=entry&a=wxapp&do=index&m=lionfish_comshop&sign=5c5dab0533d7a850a391cbb216fb4bde&controller=user.collect_voucher&token=${
									this.token
								}`
					)
				.then(res => {
					console.log(res.data);
					this.tickets = res.data.list;
			for (var i = 0; i < this.tickets.length; i++) {
				if (this.tickets[i].is_collect == 0) {
					this.tickets[i].flag = false;
				} else {
					this.tickets[i].flag = true;
				}
			}
				});
		},
		numFilter(val) {
				// 截取当前数据到小数点后两位
				let tempVal = parseFloat(val).toFixed(3)
				let realVal = tempVal.substring(0, tempVal.length - 1)
				this.totalPrice = realVal;
		},
		pay() {
			uni.navigateTo({
				url:'../pay/pay?totalPrice='+this.totalPrice
				//url:'../pay/pay'
			})
		}
	}
}
</script>
<style lang="scss">
.product {
	width: 690rpx;
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	margin-bottom: 50rpx;

	.it1 {
		width: 148rpx;
		height: 148rpx;
		background: #f7f7f7;
		border-radius: 10rpx;
		display: flex;
		align-items: center;
		justify-content: center;

		image {
			width: 120rpx;
			height: 93rpx;
		}
	}

	.it2 {
		margin-left: 30rpx;
	}

	.it3 {
		margin-right: 30rpx;
		margin-left: auto;
		margin-top: 90rpx;
	}
}

.line {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	overflow: hidden;
}

//设置轮播的指示点大小
.banner-swiper1 {
	/deep/ .uni-swiper-dots {
		// 指示点整个区域
		bottom: 100rpx;
	}
	/deep/ .uni-swiper-dot {
		// 指示点元素默认样式
		width: 40rpx !important;
		height: 6rpx !important;
		border-radius: 2rpx;
	}
}
.xinren text {
	width: 100rpx;
	height: 30rpx;
	border: 1rpx solid #ff6f00;
	border-radius: 8rpx;
	font-size: 20rpx;
	color: #ff6f00;
	padding: 2rpx;
}

.select {
	display: none;
	width: 60rpx;
	height: 8rpx;
	background-color: #00c657;
	margin: 0 auto;
	border-radius: 4rpx;
}

.horizonal-tab {
	font-size: 28rpx;
	color: #b4b4b4;
}

.horizonal-tab .active {
	color: #1b1b1b;
	font-size: 32rpx;

	.select {
		display: block;
		margin-top: -10rpx;
	}
}

.scroll-tab {
	white-space: nowrap;
	/* 必要，导航栏才能横向*/
	cursor: pointer;
	height: 140rpx;
	line-height: 100rpx;
	overflow-x: scroll;
}

.scroll-tab-item {
	display: inline-block;
	/* 必要，导航栏才能横向*/
	margin: 0 10rpx 49rpx 30rpx;
}
.btn {
	background-color: #eeeeee !important;
}
</style>
